import Toast from '../../@vant/weapp/toast/toast';
import {IMG_PATH} from '../../config/index.js'
//获取应用实例
const app = getApp()
Page({
  data: {
    active:0,
    userInfo: {},
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    //绑定宫格图片地址和文字
    taskList:[],
    imageurlList:[],
    cardList:[],
    professionFlag:true
  },
  onLoad: function () {
    let cardList = [{
      imgUrl:'../../icon/main-page/main-sign.png',
      textValue:'银行卡办理',
      navigateUrl:"../likeWork/likeWork"
    },{
      imgUrl:'../../icon/main-page/main-use.png',
      textValue:'我的银行卡',
      navigateUrl:"../register/register"
    },{
      imgUrl:'../../icon/main-page/main-query.png',
      textValue:'暂住证办理',
      navigateUrl:"../cloudPatrol/cloudPatrol"
    }];
    let taskList = [{
      imgUrl:'../../icon/main-page/main-sign.png',
      textValue:'每日签到',
      navigateUrl:"../likeWork/likeWork"
    },{
      imgUrl:'../../icon/main-page/main-use.png',
      textValue:'工资管理',
      navigateUrl:"../register/register"
    },{
      imgUrl:'../../icon/main-page/main-query.png',
      textValue:'公司信息',
      navigateUrl:"../cloudPatrol/cloudPatrol"
    },{
      imgUrl:'../../icon/main-page/main-setting.png',
      textValue:'宿舍登记',
      navigateUrl:"../holidayScheduling/holidayScheduling"
    },{
      imgUrl:'../../icon/main-page/main-use.png',
      textValue:'工作安排',
      navigateUrl:"../appraise/appraise"
    },{
      imgUrl:'../../icon/main-page/main-notice.png',
      textValue:'人才招聘',
      navigateUrl:"../message/messagePush/messagePush"
    },{
      imgUrl:'../../icon/main-page/main-notice.png',
      textValue:'工作建议',
      navigateUrl:"../message/messagePush/messagePush"
    }];
    let imageurlList = [{
      id:'1',
      url:'../../icon/main-page/bg1.jpeg'
    },{
      id:'2',
      url:'../../icon/main-page/bg2.jpeg'
    },{
      id:'3',
      url:'../../icon/main-page/bg3.jpeg'
    }];
    this.setData({
      taskList:taskList,
      cardList:cardList,
      imageurlList:imageurlList
    })
  },
  // 入职邀约点击
  professionClick(){
    wx.navigateTo({
      url: '../entryInvitation/entryInvitation',
    })
  },
  //点击图片触发事件
  imageTab(event){
    console.log(event.target.dataset.id);
  },
  //监听用户下拉刷新事件
  onPullDownRefresh(){
    wx.showNavigationBarLoading();
    setTimeout(function(){
      wx.hideNavigationBarLoading(); //完成停止加载图标
      wx.stopPullDownRefresh();
    },5000)
  }
})
